﻿<%@ Page Language="C#" MasterPageFile="~/Manage/MainPage.master"   AutoEventWireup="true" CodeFile="PurviewRoleManage.aspx.cs" Inherits="Manage_PurviewRoleManage" %>
<%@ Import Namespace="Shopping.Common" %>
<%@ Import Namespace="Shopping.Model" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content" Runat="Server">
<script type="text/javascript" src="/Manage/Js/PurviewRoleManage.js"></script>
<script type="text/javascript">
    ModelOfRole = <%=new PurviewRole().ToJsonString() %>;
    AllRes = <%=AllRes %>;
    ModelOfPrivilegeInfo = <%= JSONHelper.ObjectToJson<PrivilegeInfo>(new PrivilegeInfo()) %>;
</script>

<table width="99%" border="0" cellspacing="0" cellpadding="0" class="table" align="center"  >
  <tr class="TableHeadRow">
    <td width="50" align="center">编号</td>
    <td align="left">角色名称</td>
    <td width="80" align="center">状态</td>
    <td width="150" align="center">最后调整日期</td>
    <td width="150" align="center">创建日期</td>
    <td width="200" align="center">管理 [<a href="javascript:Add();" class="red">添加角色</a>] </td>
  </tr>
  <%
      if (listOfRoles != null)
      {
          for (int i = 0; i < listOfRoles.Count; ++i)
          {
              RoleInfo r = listOfRoles[i];
   %>
  <tr  onmouseover="this.style.backgroundColor='#F2F2F2';" onmouseout="this.style.backgroundColor='#FFFFFF';">
    <td align="center"><%=i+1 %>.</td>
    <td align="left"><a href="javascript:Edit(<%=r.Role.PurviewRoleID %>);" class="blue"><%=r.Role.RoleName %></a>
    [ID=<%=r.Role.PurviewRoleID %>] (用户数：<b><font color="red"><%=r.UsedCounts %></font></b>人)</td>
    <td align="center"><%=r.Role.Status%></td>
    <td align="center" ><%=r.Role.LastModifyDate.ToString("yyyy-MM-dd HH:mm:ss")%></td>
    <td align="center"><%=r.Role.CreateDate.ToString("yyyy-MM-dd HH:mm:ss")%></td>
    <td align="center">[<a href="javascript:Edit(<%=r.Role.PurviewRoleID %>);" class="blue">编辑</a>] &nbsp;&nbsp; [<a href="javascript:void(0)" class="red" onclick="Delete(<%=r.Role.PurviewRoleID%>,<%=r.UsedCounts %>);">删除</a>]</td>
  </tr>
  <%   }
      }
      else
      { %>
  <tr>
    <td colspan="6" align="center" class="red">[ 未找到任何角色信息！]</td>
  </tr>
  <%} %>
</table>

</asp:Content>